// https://www.luogu.com.cn/problem/B2043

#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    bool ok = false;
    if (n % 3 == 0) {
       printf("3 ");
       ok = true;
    }
    if (n % 5 == 0) {
       printf("5 ");
       ok = true;
    }
    if (n % 7 == 0) {
       printf("7 ");
       ok = true;
    }
    if (!ok) {
        printf("n");
    }
    return 0;
}
